"Colin's Gnu Privacy Guard vimrc
"http://www.gnupg.org
"Also, GPG is available as a cygwin package
"
"Used to simplify encypting and decrypting text files
"
"Note, there may be other things that could enhance the security of using GPG
"within Vim.  Might be a good idea to search www.vim.org for other ideas...

"Encode current buffer as ascii armor using the default key
"  (the default key must be specified in gpg.conf, I use default-recipient-self)
function! GpgEncrypt()
   %!gpg -e -a
endfunction
command! Encrypt :call GpgEncrypt()

"Decrypt the current buffer
function! GpgDecrypt()
   "Turn off the swap file so that sensitive text is not stored on disk
   echo "Turning off swap file..."
   set noswapfile
   echo "Enter passphrase on shell window!"
   %!gpg -d
   %s/$//
   1
endfunction
command! Decrypt :call GpgDecrypt()

